﻿//@ Shweta
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using DAL_V1.App_Code.DBBroker;
using EntityObjects;

namespace BAL.Controller
{
    public class ApproveRequisitionController
    {
    
        protected RequisitionDBBroker Requisitionbk;
        protected EmployeeDBBroker empbk;
        public ApproveRequisitionController()
        {
            
            Requisitionbk = RequisitionDBBroker.getRequisitionDBBroker();
            empbk = EmployeeDBBroker.getEmployeeDBBroker();

        }


        public List<Requisition> getRequistion()
        {

            return Requisitionbk.getRequistionByAppliedStatus();
        }
        public int setReqStatus(Requisition rq, int reqID)
        {
            int check = 0;
            try
            {
                check = Requisitionbk.updateRequisition(rq, reqID);
                return check;
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public List<RequisitionItems> getRequisitionItemsbyReqFormId(int reqFormId)
        {
            return Requisitionbk.getRequisitionItemsbyReqFormId(reqFormId);
        }
        public Employee selectEmployee(String Id)
        {
            return empbk.selectEmployee(Id);
        }
        public Requisition selectRequisition(int Id)
        {
            return Requisitionbk.selectRequisition(Id);
        }
        public List<Requisition> getRequisitionByDeptIdAndAppliedStatus(String deptId)
        {
            return Requisitionbk.getRequisitionByDeptIdAndAppliedStatus(deptId);
        }
    }
}

